# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-activesupport
_gemname=activesupport
pkgver=7.2.1
pkgrel=0
pkgdesc="Utility classes and Ruby extensions from Rails"
url="https://rubyonrails.org/"
arch="noarch"
license="MIT"
depends="
	ruby
	ruby-concurrent-ruby
	ruby-i18n
	ruby-minitest
	ruby-tzinfo
	"
checkdepends="ruby-rake"
source="https://github.com/rails/rails/archive/v$pkgver/ruby-activesupport-$pkgver.tar.gz"
builddir="$srcdir/rails-$pkgver/activesupport"
options="!check"  # FIXME

# secfixes:
#   7.0.4.3-r0:
#     - CVE-2023-28120
#     - CVE-2023-22796

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions plugins
}

sha512sums="
3ba68311f5b15fac647047d5e2bdbf0bf088ee4bd1208f3a47064cc7bc10794bf28f94aaabf410b773c6ff90638c8f08ebb74297855a303d080ffea9e96d25ef  ruby-activesupport-7.2.1.tar.gz
"
